Transformations

On this page:

Transformation Options

Overview

This guide will cover the options available when working with JSON Schema Transformations (JST) in the Gen 1 and Gen 2 canvas of Itential Automation Platform (IAP) for the 2021.1 release.

The steps involved in selecting JST options for the Gen 1 canvas will be discussed first, followed by the options that are available in the Gen 2 canvas.

Create Workflow

From the IAP home page:

  1. Select Automation Studio from the left navbar. The application screen displays.

  2. Select + Create a Workflow from the Quick Start card. The Create dialog opens.

    Figure 1: Automation Studio

    Workflows

  3. Select Workflow from the dropdown list and enter a name (required) for the workflow.

  4. Select the appropriate IAP canvas (Gen 1 or Gen 2) and then click Create. The workflow canvas displays.

    Figure 2: Create Workflow

    Create Workflow

GEN 1 Workflow

To add a JST in the Gen 1 Workflow canvas:

  1. In the Search bar (top-right corner), type JST to locate the transformation task.

  2. Click the plus (+) sign to the left of the task. This will add a new JST task labeled JSON Transformation to the Gen 1 canvas.

    Figure 3: Add JST Task (Gen 1)

    Add JST Task

  3. Connect the JST task to the Start and End tasks. You can also hover over the JST task to display the tooltip.

    Figure 4: Connect JST Task (Gen 1)

    Connect JST Task

  4. Double-click the JSON Transformation task. The edit modal displays.

    Figure 5: Edit JST Task (Gen 1)

    Edit JST Task

  5. Select the appropriate options (see table below) you would like to use prior to running your transformation.

    Option (Gen 1) Description
    Mask Outgoing Schema This option is available on all tasks. It encrypts outgoing vars and displays them as asterisks in Job Manager.
    Validate Incoming Validates your input. Checks if the input is the correct type and compatible with the enum set of constants in that incoming schema.
    Revert To Default Value Enables use of a default keyword.
    • Default values from the incoming schemas will be used whenever a key/incoming data value is not provided.
    • If an outgoing schema has a default value, an incoming schema is assigned to it.
    • If the incoming schema does not have a default defined, then the default for the outgoing schema will be used.
    • If an outgoing schema has a default value defined, and nothing is assigned to it, then the default values will be in the transformation output.
  6. Click Save and you will return to the Gen 1 Workflow canvas.

  7. Click the Start button (top-left) to run the transformation.

    Figure 6: Run JST (Gen 1)

    Run JST


GEN 2 Workflow

To add a JST in the Gen 2 Workflow canvas:

  1. Select Gen 2 in the dialog and click Create. A relatively blank Gen 2 canvas then displays that contains a Start and End task.

    Figure 7: Create Workflow (Gen 2)

    Gen 2 Workflow

  2. When a Gen 2 workflow is first created, a New Node box is already provided. This is an empty node and needs to be populated with an actual task item.

  3. Click the New Node box on the Gen 2 canvas.

  4. Go to the Task Menu Sidebar on the right side of the screen. This area contains a list of nodes and tasks that can be used in the Gen 2 workflow.

  5. In the Search bar at the top, type JST to locate the transformation task.

  6. Click the transformation task and observe that the "New Node" on the canvas has been replaced with the transformation task. Also notice that the Task Menu Sidebar is now replaced with details and configuration options for the transformation task.

  7. Click Save to retain changes to the Gen 2 Workflow.

    Figure 8: Save Workflow (Gen 2)

    Save Gen 2 Workflow

  8. Click the transformation node to select options.

  9. On the Details tab, you can select the Mask Outgoing Variables option. See the table below.

    Figure 9: Details Tab (Gen 2)

    Select JST Options

  10. Click the Options Tab to select Validate Incoming or revertToDefaultValue, as required. Details for all JST options in Gen 2 workflows are referenced in the table below.

    Figure 10: Options Tab (Gen 2)

    Additional JST Options

    Option (Gen 2) Description
    Mask Outgoing Variable This option is available on all tasks. It encrypts outgoing vars and displays them as asterisks in Job Manager.
    Validate Incoming Validates your input. Checks input is the correct type and compatible with enums/const set in that incoming schema.
    revertToDefaultValue Enables use of default keyword.
    • Default values from the incoming schemas will be used whenever a key/incoming data value is not provided.
    • If an outgoing schema has a default value, an incoming schema is assigned to it.
    • If the incoming schema does not have a default defined, then the outgoing schema's default will be used.
    • If an outgoing schema has a default value defined, and nothing is assigned to it, then the default values will be in the transformation's output.
  11. Click the Save icon (floppy disk) to retain your JST options.

  12. Click the Start button to run the workflow.

    Figure 11: Icons to Save and Run (Gen 2)

    Save and Run Gen 2 Workflow